package com.mstore.dao;

import java.util.List;

import com.mstore.pojo.ConsumeDeleteLog;

public class ConsumeDeleteLogDao extends SuperDao {

	public void save(ConsumeDeleteLog consumeDeleteLog) {
		super.save(consumeDeleteLog);
	}

	public Object findById(ConsumeDeleteLog consumeDeleteLog) {
		String hql = "from ConsumeDeleteLog where id=?";
		List<Object> objects = super.getObject(hql,
				new Object[] { consumeDeleteLog.getId() });
		if (objects.size() > 0) {
			return objects.get(0);
		}
		else {
			return null;
		}
	}

	public void updateById(ConsumeDeleteLog consumeDeleteLog) {
		/*String sql = "update  log_consume_delete   set  create_time='"
				+ consumeDeleteLog.getCreateTime() + "',  log_score_delete_id="
				+ consumeDeleteLog.getLogScoreDeleteId() + "  where  id="
				+ consumeDeleteLog.getId();
		super.executeUpdate(sql);*/
		
		StringBuilder sb = new StringBuilder();
		sb.append("update  log_consume_delete   set  create_time='");
		sb.append(consumeDeleteLog.getCreateTime() );
		sb.append("',  log_score_delete_id=");
		sb.append(consumeDeleteLog.getLogScoreDeleteId());
		sb.append("  where  id=");
		sb.append(consumeDeleteLog.getId());
		super.executeUpdate(sb.toString());
	}
}
